@sider-padding: 16px;
@sider-width: 56px;
@icon-width: 20px;
@sider-background: #1e1f23;
@transition-time: 0.2s;
@active-white: #ffffff;
@default-white: #767d87;

.sider {
  overflow-y: auto;
  border-top: 1px solid #000000;

  .ant-layout-sider-children {
    background-color: @sider-background;
  }

  .title {
    display: flex;
    align-items: center;
    height: 48px;
    padding-left: @sider-padding;
    font-size: 18px;
    color: #ffffff;
    white-space: nowrap;

    .value {
      flex: 1;
    }

    .collapse {
      display: inline-block;
      padding: 2px;
      text-align: center;
      border-radius: 2px 0px 0px 2px;
      color: #ffffff;
      cursor: pointer;
      transition: all 0.3s;

      &:hover {
        color: #ffffff;
      }
    }
  }

  .ant-menu {
    border: none;
    background-color: inherit;

    .ant-menu-submenu {
      background-color: @sider-background;
      transition: all ease-in-out @transition-time;
      .icon-knowledge-base {
        font-size: 18px;
        width: 21px;
        display: inline-block;
        &::before {
          font-size: 14px;
          top: 1px;
          left: 4px;
        }
      }
      .ant-menu-submenu-title {
        .icon {
          transition: all ease-in-out @transition-time;
        }
        &:hover a {
          color: @active-white;
        }
        &:hover .ant-menu-submenu-arrow::before,
        &:hover .ant-menu-submenu-arrow::after {
          background: @active-white !important;
        }
      }

      .ant-menu-submenu-arrow {
        right: @sider-padding !important;
        top: 52% !important;
      }

      .ant-menu-item {
        a {
          position: relative;
          padding-left: @sider-padding + @icon-width;
          background-color: @sider-background;
          transition: all ease-in-out @transition-time;

          &::before {
            position: absolute;
            top: 0;
            left: 0;
            display: block;
            width: 4px;
            height: 0;
            background-color: #0b6fd6;
            transition: all ease-in-out @transition-time;
          }
          &:active {
            background-color: #000000;
          }
          &.active {
            background-color: #000000;
            &::before {
              height: 100%;
            }
          }
        }
      }
      &-selected {
        .ant-menu-submenu-title {
          .icon {
            color: @active-white;
          }
        }
      }
    }

    .ant-menu-submenu-title,
    .ant-menu-item {
      width: 100% !important;
      padding: 0 !important;
      a {
        padding-left: @sider-padding;
        color: @default-white;
        transition: all ease-in-out @transition-time;
        &.active {
          color: @active-white;
        }
        &:hover {
          color: @active-white;
        }
      }
      &::after {
        display: none;
      }
      &:active {
        background-color: inherit;
      }
    }

    &.ant-menu-inline-collapsed {
      width: 100% !important;
      a.active,
      .ant-menu-submenu-selected .ant-menu-submenu-title {
        background-color: #000000;
      }
      .item-name {
        display: none;
      }
      .ant-menu-submenu-title,
      .ant-menu-item {
        transition: background-color ease-in-out @transition-time;
        &:active {
          background-color: #000000;
        }
      }
    }

    .ant-menu-item-selected {
      background-color: inherit !important;
    }
  }

  .icon::before {
    position: relative;
    font-size: 20px;
    top: 4px;
    color: inherit !important;
  }
  &-submenu-popup {
    left: @sider-width + 1px !important;
    border-radius: 2px;
    .ant-menu {
      min-width: 120px;
      max-height: 300px;
      overflow: auto;
      background-color: @sider-background;
      border-radius: 2px;
      a {
        padding: 0 12px;
        color: @default-white;
        transition: all 0.36s;
        &.active {
          color: @active-white;
        }
        &:hover {
          color: @active-white;
        }
      }
      .ant-menu-item {
        margin: 4px 0;
        padding: 0;
        &.ant-menu-item-selected,
        &:active {
          background-color: @sider-background;
        }
      }
    }
  }
}
